﻿<div class="layui-form" lay-filter="layuiadmin-app-form-list" id="layuiadmin-app-form-list" style="padding: 20px 30px 0 0;">

    <script type='text/html' template>
        <input type='hidden' name='PID' value="{{ d.params.PID || '' }}" />
    </script>
    <div class='layui-form-item'>
        <label class='layui-form-label'>店铺名称</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' name='Name' value='{{ d.params.Name || '' }}' lay-verify='required' placeholder='店铺名称' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    <!--<div class='layui-form-item'>
        <label class='layui-form-label'>店铺编码</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' name='Code' value='{{ d.params.Code || '' }}' lay-verify='required' placeholder='店铺编码' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>-->

    <div class='layui-form-item'>
        <label class='layui-form-label'>店铺Logo</label>
        <div class='layui-input-block'>
            <div class="layui-upload">
                <div class="layui-upload-list" id="divImgs"></div>
                <script type='text/html' template lay-done='layui.data.setUploads(d.params);'>
                    <input type="hidden" name="Logo" id="Logo" value="{{ d.params.Logo || '' }}">
                </script>
                <hr />
            </div>
        </div>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>店铺简介</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' name='Introduce' value='{{ d.params.Introduce || '' }}' lay-verify='' placeholder='店铺简介' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>联系人</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' name='UserName' value='{{ d.params.UserName || '' }}' lay-verify='required' placeholder='联系人' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>联系电话</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' name='Phone' value='{{ d.params.Phone || '' }}' lay-verify='required' placeholder='联系电话' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>所属县/区</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' name='Area' value='{{ d.params.Area || '' }}' lay-verify='required' placeholder='所属县/区' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>详细地址</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' name='Address' value='{{ d.params.Address || '' }}' lay-verify='required' placeholder='详细地址' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>坐标</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' name='Gps' value='{{ d.params.Gps || '' }}' lay-verify='required' placeholder='坐标' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    <div class='layui-form-item'>
        <label class='layui-form-label'>状态 </label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <select name='State_Sel'>
                    <option value='0' {{ d.params.State_Sel == '0' ? 'selected' : '' }}>启用</option>
                    <option value='1' {{ d.params.State_Sel == '1' ? 'selected' : '' }}>停用</option>
                </select>
            </script>
        </div>
    </div>

    <div class='layui-form-item'>
        <label class='layui-form-label'>备注</label>
        <div class='layui-input-block'>
            <script type='text/html' template>
                <input type='text' name='RMK' value='{{ d.params.RMK || '' }}' lay-verify='' placeholder='备注' autocomplete='off' class='layui-input'>
            </script>
        </div>
    </div>
    <div class="layui-form-item">
        <label class="layui-form-label"></label>
        <div class="layui-input-inline">
            <input type="button" onclick="Close()" value="关闭" class="layui-btn">
        </div>
    </div>
</div>
<style>
    .layui-upload-img {
        width: 100px;
        height: auto;
    }
</style>

<script type="text/javascript">
    function Close() {
        layer.closeAll();
    }

    var form, admin, $;
    layui.use(['form','admin','upload','laydate'], function () {
        form = layui.form;//required（必填项）phone（手机号）email（邮箱）url（网址）number（数字）date（日期）identity（身份证） 自定义值
        $ = layui.$;
        admin = layui.admin;

    });
    
    layui.data.setUploads = function (d) {
        layui.use(['jquery', 'upload', 'admin'], function () {
            window.jQuery = window.$ = layui.jquery;
            upload = layui.upload,
            admin = layui.admin;

            var pics = d.Logo;
            if (pics != "" && pics != null && pics != 'null') {
                addImg({ name: pics, path: layui.setter.ImgPath + pics });
            }
        })
    }
    function addImg(src) {
        var div = "divimg3";
        var img = "Img3";
        var html = "    <div style=\"line-height:100px;float:left\" id='" + div + "'> " +
                           " <img id='" + img + "' src=\"" + src.path + "\"   alt=\"\" class=\"layui-upload-img\">" +
                       "</div>";
        $('#divImgs').html(html);
        $("#Logo").val(src.name);
    }




</script>
